package com.demo;

import com.demo.mapper1.Activity;
import com.demo.mapper1.ActivityMapper;
import com.demo.mapper2.ActivityMapper2;
import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 描述：
 * 作者 张超
 * 时间 2018/6/5
 * 项目 springboot-demo v2.0
 * 版本 v1.0
 */

@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired(required = false)
    private ActivityMapper activityMapper;

    @Autowired(required = false)
    private ActivityMapper2 activityMapper2;
    @GetMapping("/get")
    @ResponseBody
    public Object get(@RequestParam(required = false)Integer id){
        Map<String,Object> activity = activityMapper.get(id);
        Map<String,Object> activity2 = activityMapper2.get(id);
        System.err.println(new Gson().toJson(activity2));
//        Activity activity = activityMapper.get(id);
        System.err.println(new Gson().toJson(activity));
        System.err.println("aa2");
        return  activity;
    }
}
